#ifndef IMAGEOBJ_H
#define IMAGEOBJ_H

#include <iostream>
#include <fstream>
#include <QtGui>
#include "RGBColor.h"
#include <cmath> //NLE

using namespace std;
#define PI 3.14159265
typedef unsigned long ulong;
typedef unsigned char uchar;

class ImageObj
{
public:
		char* format;
		ulong fileSize;
		ulong beginData;
		ulong sizeHeader;
		ulong width;
		ulong height;
		ulong colorPlane;
		ulong bitByPixel;
		ulong compression;
		ulong sizeData;
		ulong horizontalResolution;
		ulong verticalResolution;
		ulong colorByPalette;
		ulong importantColor;
		ulong paddingBytes;

		long* selectRectangle;

		long getCropX();
		long getCropY();
		long getCropWidth();
		long getCropHeight();

		RGBColor** image;

		ImageObj(void);
		ImageObj(long width, long height);
		ImageObj(ulong _fileSize, ulong _beginData, ulong _sizeHeader, ulong _width, ulong _height, ulong _colorPlane,
				   ulong _bitByPixel, ulong _compression, ulong _sizeData, ulong _horizontalResolution,
				   ulong _verticalResolution, ulong _colorByPalette, ulong _importantColor, RGBColor** _image);
		void createImage(long width, long height);
		void cropImage(ulong _width, ulong _height, RGBColor** _image);
		void openImage(const char*);
		void writeImage(const char*);
		void painter(QPainter *painter);
		bool contains(long x, long y);
		void cropRectangle(long cropX, long cropWidth,long cropY,long cropHeight);
		RGBColor** DCT8(RGBColor** part); //NLE
		RGBColor** compositeDCT();//NLE
		ImageObj& operator=(const ImageObj& that);
		~ImageObj();
};

#endif
